home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_c / cuj0696.zip / DWYER.ZIP / LIB / ABRTGCLY.C next >
C/C++ Source or Header  |  1995-12-01  |  1KB  |  42 lines

  1. /* ============ */
  2. /* abrtgcly.c    */
  3. /* ============ */
  4. #include <signal.h>
  5. #include <stdlib.h>
  6. /* ==================================================================== */
  7. /* HaltProcess - Performs exit via AbortGracefully when ^C is Pressed    */
  8. /* ==================================================================== */
  9. # if 0
  10. # if defined(__STDC__) || defined(__PROTO__)
  11. static void
  12. HaltProcess(int unused)
  13. # else
  14. static void
  15. HaltProcess(unused)
  16. int    unused;
  17. # endif
  18. {
  19.     if (unused || !unused)
  20.     exit(1);
  21. }
  22. # endif
  23. /* ==================================================================== */
  24. /* AbortGracefully - does the right thing at <CTRL> C or <CTRL> break    */
  25. /* ==================================================================== */
  26. # if defined(__STDC__) || defined(__PROTO__)
  27. void
  28. AbortGracefully(void)
  29. # else
  30. void
  31. AbortGracefully()
  32. # endif
  33. {
  34.     /* -------------------- */
  35.     /* Execute exit() on ^C */
  36.     /* -------------------- */
  37. # if 0
  38.     signal(SIGINT, HaltProcess);
  39. # endif
  40.     signal(SIGINT, exit);
  41. }
  42.